package com.method;

/*
定义一个方法判断两个数组是否一样
*/
public class Demo05 {
    public static void main(String[] args) {
        int[] Arr1 = {1, 2, 3};
        int[] Arr2 = {1, 2, 3};
        resoult(Arr1, Arr2);
    }

    public static void resoult(int[] arr1, int[] arr2) {
        String a = "";
        if (arr1.length != arr2.length) {
            System.out.println("两个数组长度不一样肯定不一样！");
            return;
        }
        for (int i = 0; i < arr1.length; i++) {
            a = arr1[i] == arr2[i] ? "相同" : "不同";
        }
        System.out.println(a);
//        if (a == 1) {
//            System.out.println("两个数组一样！");
//        } else {
//            System.out.println("两个数组不一样！");
//        }
    }
}
